#ifndef RELSEND_H
#define RELSEND_H

	#include "network.h"
	#include "common.h"

	#define BUFSIZE 1200
	
	// This application's binded port number.
	extern unsigned short relsendPort;
	
	//The socket file descriptor for relsend.
	extern int socketfd; 
	
	// relrecv port number.
	extern unsigned short relrecvPort;
	
	// Stores filename.
	extern char filename[20];
	
	// Message buffer to be sent to the relrecv.
	extern unsigned char sendMessage[BUFSIZE];
		
	// relrecv IP address.
	extern char address[16];
	
	extern int currentSequenceNumber;
	
	extern int expectedFinalSequenceNumber;
	
	extern struct messageInfo msgInfo;

	// Parses the command-line arguments.
	void parseCommandLine(int argc, char ** argv);
	// Matches a pattern within an array of characters using regular expression.
	int match(const char * string, char * pattern);
	//void createSocket(unsigned short portNumber);
	void sendFile(int socketFileDescriptor, char * address, unsigned int relrecvPort );
		

	
#endif